import Vue from 'vue';

const formdragerUrl = '/form/api/formdrager/';
const formvalueUrl = '/form/api/value/';

export const getValueByNames = (params: any, recId = 0, taskListGroupId = 0, bizId = 0, subId: number = 0) => {
    return Vue.prototype.$axios.post(`/custom/api/getvaluebynames?recId=${recId}&taskListGroupId=${taskListGroupId}&bizId=${bizId}&subId=${subId}`, params);
}

export const loadGridsById = (params: any) => {
    return Vue.prototype.$axios.get(`/system/api/grid/loadgridsbyid`, params);
}

export const getAreaGridsByPoint = (params: any) => {
    return Vue.prototype.$axios.get(`/system/api/grid/getAreaGridsByPoint`, params);
}

export const getGridReportFlagByDutyGridId = (params: any) => {
    return Vue.prototype.$axios.get(`/system/api/grid/getGridReportFlagByDutyGridId`, params);
}

export const getAvalibleAssemblies = (params: any) => {
    return Vue.prototype.$axios.get(`${formdragerUrl}assemblies`, params);
}

export const formAddAssembly = (params: any) => {
    return Vue.prototype.$axios.post(`${formdragerUrl}createassembly`, params);
}

export const loadAssembliesByFormId = (params: any) => {
    return Vue.prototype.$axios.get(`${formdragerUrl}loadformassemblies`, params);
}

export const clearFormDrager = (params: any) => {
    return Vue.prototype.$axios.get(`${formdragerUrl}clear`, params);
}

export const removeAssemblyInst = (params: any) => {
    return Vue.prototype.$axios.get(`${formdragerUrl}delete`, params);
}

export const saveFromDrager = (params: any) => {
    return Vue.prototype.$axios.post(`${formdragerUrl}saveassemblies`, params);
}

export const moveAssembly = (params: any) => {
    return Vue.prototype.$axios.get(`${formdragerUrl}moveassembly`, params);
}

export const loadFormValue = (params: any) => {
    return Vue.prototype.$axios.post(`${formvalueUrl}loadvalue`, params);
}

export const saveUpdateFormValue = (params: any) => {
    return Vue.prototype.$axios.post(`${formvalueUrl}saveupdatevalue`, params);
}
